/*
 * Copyright 2007. Mount Sinai Hospital, Toronto, Canada.
 * 
 * Licensed under the GNU Lesser General Public License, Version 2. You
 * can find a copy of the license at:
 * 
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
 * 
 * IN NO EVENT SHALL MOUNT SINAI HOSPITAL BE LIABLE TO ANY PARTY FOR DIRECT, 
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST 
 * PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 
 * EVEN IF MOUNT SINAI HOSPITAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 
 * DAMAGE.
 * 
 * MOUNT SINAI HOSPITAL SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND 
 * ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". 
 * MOUNT SINAI HOSPITAL HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, 
 * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
 */
package com.sinai.mshab.client.util;

import com.sinai.mshab.client.ui.FormComponent;

/**
 * The ComponentRegistry class offers a service to register
 * {@link FormComponent}s to allow retrieval of the registered FromComponents
 * from any class within the application utilizing a unique identifier.
 * 
 * @author Arthur Kalmenson
 */
public interface ComponentRegistry {

	/**
	 * Registers the {@link FormComponent}, question, using question's getId()
	 * method to retrieve its unique identifier.
	 * 
	 * @param component
	 *            the FormComponent to register.
	 */
	public void register(FormComponent component);

	/**
	 * Returns the {@link FormComponent} who's unique identifier is equal to
	 * identifier.
	 * 
	 * @param identifier
	 *            the id that was used to register the desired FormComponent.
	 * @return the {@link FormComponent} who's unique identifier is equal to
	 *         identifier.
	 */
	public FormComponent get(String identifier);

	/**
	 * Resets all info in the regisry.
	 */
	public void reset();
}
